<?php
// +----------------------------------------------------------------------
// | 小牛Admin
// +----------------------------------------------------------------------
// | Website: www.xnadmin.cn
// +----------------------------------------------------------------------
// | Author: dav <85168163@qq.com>
// +----------------------------------------------------------------------

namespace app\common\validate;

use think\Validate;

class Login extends Validate
{
    protected $rule = [
        'username' => 'require|min:2',
        'mobile' => 'mobile',
        'email' => 'email',
        'password' => 'min:6',
        'repassword'=>'confirm:password',
    ];

    protected $message = [
        'username.require' => '用户名不能为空！',
        'username.min' => '用户名最少2位！',
        'mobile.mobile' => '手机号码不正确！',
        'email.email' => '邮箱不正确！',
        'password.min' => '密码最少6位！',
        'repassword.confirm' => '两次输入密码不一致！',
    ];

    protected $scene = [
        'login'  =>  ['mobile','password'],
        'register'  =>  ['username','mobile','email','password','repassword'],
        'forget' => ['mobile','password','repassword'],
        'password' => ['password','repassword'],
    ];
}
